Arithmetic Function Interpreter in C# 3.0 Using Lambda Expression Trees
نویسنده
چکیده
Here the first generic parameter indicates that the independent variable, x, is of type double and the second generic parameter, of type double, is the return type. In general a lambda expression is written as a parameter list, followed by the => token, followed by an expression or a statement block. Expression trees, another new C# 3.0 feature, allow lambda expressions to be represented as data structures instead of executable code. Expression trees are “efficient in-memory data representations of lambda expressions and make the structure of the expression transparent and explicit” (Microsoft C# 3.0 Specifications -http://msdn2.microsoft.com/en-us/library/ms364047(vs.80).aspx#cs3spec_topic9 ). An expression tree could be defined as follows:
منابع مشابه
The second geometric-arithmetic index for trees and unicyclic graphs
Let $G$ be a finite and simple graph with edge set $E(G)$. The second geometric-arithmetic index is defined as $GA_2(G)=sum_{uvin E(G)}frac{2sqrt{n_un_v}}{n_u+n_v}$, where $n_u$ denotes the number of vertices in $G$ lying closer to $u$ than to $v$. In this paper we find a sharp upper bound for $GA_2(T)$, where $T$ is tree, in terms of the order and maximum degree o...
متن کاملA Transformational Interpreter for Goal-Directed Evaluation
We develop a Java-based interpreter for the Unicon programming language using transformation, first into an iterator calculus and from there into the dynamic language Groovy. In Unicon every expression is a generator that produces values until it fails, and operations are conditioned on success and failure. The transformations first normalize primary expressions by flattening nested generators ...
متن کاملA Size-Proportionate Bijective Encoding of Lambda Terms as Catalan Objects Endowed with Arithmetic Operations
We describe a size-proportionate bijection between lambda terms in a compressed de Bruijn notation and the Catalan family of combinatorial objects implemented as a Haskell type class, that has as instances binary trees and multiway-trees with empty leaves, as well as standard bitstring-represented natural numbers. By building on previous work that defines arithmetic operations on instances of t...
متن کاملOn the first variable Zagreb index
The first variable Zagreb index of graph $G$ is defined as begin{eqnarray*} M_{1,lambda}(G)=sum_{vin V(G)}d(v)^{2lambda}, end{eqnarray*} where $lambda$ is a real number and $d(v)$ is the degree of vertex $v$. In this paper, some upper and lower bounds for the distribution function and expected value of this index in random increasing trees (rec...
متن کاملApproximate solutions of homomorphisms and derivations of the generalized Cauchy-Jensen functional equation in $C^*$-ternary algebras
In this paper, we prove Hyers-Ulam-Rassias stability of $C^*$-ternary algebra homomorphism for the following generalized Cauchy-Jensen equation $$eta mu fleft(frac{x+y}{eta}+zright) = f(mu x) + f(mu y) +eta f(mu z)$$ for all $mu in mathbb{S}:= { lambda in mathbb{C} : |lambda | =1}$ and for any fixed positive integer $eta geq 2$ on $C^*$-ternary algebras by using fixed poind alternat...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
- Journal of Object Technology
دوره 7 شماره
صفحات -
تاریخ انتشار 2008